package pl.bizuteria.sklep.admin.client.ui.product;

import pl.bizuteria.sklep.admin.client.place.ProxyListPlace;
import pl.bizuteria.sklep.api.shared.proxy.BraceletProxy;
import pl.bizuteria.sklep.api.shared.proxy.ClipProxy;
import pl.bizuteria.sklep.api.shared.proxy.EaringProxy;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.place.shared.PlaceController;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

public class ProductButtonView extends Composite {

	private static ProductButtonViewUiBinder uiBinder = GWT
			.create(ProductButtonViewUiBinder.class);

	interface ProductButtonViewUiBinder extends
			UiBinder<Widget, ProductButtonView> {
	}

	@UiField
	Button allButton;

	@UiField
	Button earingButton;

	@UiField
	Button clipButton;

	@UiField
	Button braceletButton;

	private PlaceController placeController;

	@UiHandler("allButton")
	public void onClick(ClickEvent e) {
		// tutaj all
	}

	@UiHandler("earingButton")
	public void onClick2(ClickEvent e) {
		placeController.goTo(new ProxyListPlace(EaringProxy.class));
	}

	@UiHandler("clipButton")
	public void onClick3(ClickEvent e) {
		placeController.goTo(new ProxyListPlace(ClipProxy.class));
	}

	@UiHandler("braceletButton")
	public void onBraceletsClick(ClickEvent e) {
		placeController.goTo(new ProxyListPlace(BraceletProxy.class));
	}

	@Inject
	public ProductButtonView(PlaceController placeController) {
		this.placeController = placeController;
		initWidget(uiBinder.createAndBindUi(this));
	}

}
